package io.renren.modules.medical.entity.history;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 
 * 
 * @author luosheng
 * @email luoshengshuai@foxmail.com
 * @date 2023-05-06 17:16:13
 */
@Data
@TableName("operation_history")
public class OperationHistoryEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 主键
	 */
	@Null(message = "手术历史主键只能为空", groups = {AddGroup.class, UpdateGroup.class})
	@TableId(type = IdType.AUTO)
	private Long id;

	/**
	 * 是否是患者治疗历史
	 */
	@NotNull(message = "isKoa不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@JsonIgnore
	private Integer isKoa;
	/**
	 * 手术名称
	 */
	@NotBlank(message = "手术名称不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String operationName;
	/**
	 * 治疗单位
	 */
	@NotBlank(message = "治疗单位不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String treatmentUnit;
	/**
	 * 开始日期
	 */
	@NotNull(message = "开始日期不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
	private Date startTime;
	/**
	 * 结束日期
	 */
	@NotNull(message = "结束日期不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
	private Date endTime;
	/**
	 * 是否删除
	 */
	@Null(message = "不用指定是否删除", groups = {AddGroup.class, UpdateGroup.class})
	@JsonIgnore
	@TableLogic
	private Integer isDeleted;

}
